<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Single-file HTML</title>
  </head>
  <body>
    <div id="app"></div>
    <script type="module">
      import {$, h, render} from 'https://esm.sh/voby';

      const Counter = () => {

        const value = $(0);

        const increment = () => value ( prev => prev + 1 );
        const decrement = () => value ( prev => prev - 1 );

        return [
          h ( 'h1', 'Counter' ),
          h ( 'p', value ),
          h ( 'button', { onClick: increment }, '+' ),
          h ( 'button', { onClick: decrement }, '-' )
        ];

      };

      render ( Counter, document.getElementById ( 'app' ) );
    </script>
  </body>
</html>
